home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue31 / construc / ANALWORD.DPR next >
Encoding:
Text File  |  1998-02-06  |  495 b   |  23 lines

  1. {$A+,B-,D-,E-,F-,G-,I-,L-,N-,O-,P-,Q-,R-,S+,T-,V+,X+,Z-}
  2. {$APPTYPE CONSOLE}
  3. program AnalWord;
  4. var
  5.   IndexFile: Text;
  6.   Str: ShortString;
  7.   Words,MaxLen: Integer;
  8. begin
  9.   Assign(IndexFile,'wordlist');
  10.   Reset(IndexFile);
  11.   Words := 0;
  12.   MaxLen := 0;
  13.   while not eof(IndexFile) do
  14.   begin
  15.     Inc(Words);
  16.     readln(IndexFile,Str);
  17.     if Length(Str) > MaxLen then MaxLen := Length(Str)
  18.   end;
  19.   Close(IndexFile);
  20.   writeln(Words,' words of max. ',MaxLen,' length...')
  21. end.
  22.  
  23.